using PetaPoco;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace BlazorAdmin.Models
{
    [PrimaryKey("ID")]
    [TableName($"{nameof(Device)}s")]
    public class Device
    {
        /// <summary>
        /// 主键
        /// </summary>
        [NotNull]
        [DisplayName("主键")]
        public int ID { get; set; }

        /// <summary>
        /// 获取或设置 设备GUID Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备GUID")]
        [MaxLength(32, ErrorMessage = "{0}不能超过 32 个字符")]
        public string Guid { get; set; }

        /// <summary>
        /// 获取或设置 设备IP地址 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备IP地址")]
        [MaxLength(20, ErrorMessage = "{0}不能超过 20 个字符")]
        public string IP { get; set; }

        /// <summary>
        /// 获取或设置 设备MAC地址 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备MAC地址")]
        [MaxLength(60, ErrorMessage = "{0}不能超过 60 个字符")]
        public string? Mac { get; set; }

        /// <summary>
        /// 获取或设置 主机名称 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("主机名称")]
        [MaxLength(100, ErrorMessage = "{0}不能超过 100 个字符")]
        public string Host { get; set; }

        /// <summary>
        /// 获取或设置 系统信息 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("系统信息")]
        [MaxLength(200, ErrorMessage = "{0}不能超过 200 个字符")]
        public string OS { get; set; }

        /// <summary>
        /// 获取或设置 固定资产号 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("固定资产号")]
        [MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
        public string AssetNo { get; set; }

        /// <summary>
        /// 获取或设置 设备类型 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备类型")]
        [MaxLength(20, ErrorMessage = "{0}不能超过 20 个字符")]
        public string DeviceType { get; set; }

        /// <summary>
        /// 获取或设置 设备位置 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备位置")]
        [MaxLength(200, ErrorMessage = "{0}不能超过 100 个字符")]
        public string Location { get; set; }

        /// <summary>
        /// 获取或设置 设备备份目录 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("设备备份目录")]
        [MaxLength(100, ErrorMessage = "{0}不能超过 100 个字符")]
        public string BackupDir { get; set; }

        /// <summary>
        /// 获取或设置 上传路径 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("上传路径")]
        [MaxLength(100, ErrorMessage = "{0}不能超过 100 个字符")]
        public string UploadPath { get; set; }

        /// <summary>
        /// 获取或设置 客户端策略控制软件版本号 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("版本号")]
        [MaxLength(20, ErrorMessage = "{0}不能超过 10 个字符")]
        public string Version { get; set; }

        /// <summary>
        /// 获取或设置 状态 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("状态")]
        [MaxLength(20, ErrorMessage = "{0}不能超过 20 个字符")]
        public string Status { get; set; }

        /// <summary>
        /// 获取或设置 更新人 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("更新人")]
        [MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
        public string Updater { get; set; }

        /// <summary>
        /// 获取或设置 更新时间 Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("更新时间")]
        public DateTime UpdateTime { get; set; }

        #region 添加的成员

        [ResultColumn]
        [DisplayName("组织名称")]
        public string OrgName { get; set; }

        #endregion
    }
}
